package com.chexiehui.jc.mvp.car;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BaseView;
import com.chexiehui.jc.entity.CarInfo;
import com.chexiehui.jc.entity.CarSeriesInfo;
import com.chexiehui.jc.entity.TelInfo;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 车辆列表
 * @Auth SongJun
 * @Date 2020/05/21 00:18
 **/
public interface CarSeriesDetailsCovenant {

    interface View extends BaseView {
        void onGetSeriesInfoSuccess(BaseModel<CarSeriesInfo> successResult);
        void onGetSeriesInfoFailure(BaseModel<Object> failureResult);
        void onAddInstallmentSuccess(BaseModel<Object> successResult);
        void onAddInstallmentFailure(BaseModel<Object> failureResult);
        void onAddShopInquirySuccess(BaseModel<Object> successResult);
        void onAddShopInquiryFailure(BaseModel<Object> failureResult);
        void onGetSalespersonTelSuccess(BaseModel<TelInfo> successResult);
        void onGetSalespersonTelFailure(BaseModel<Object> failureResult);

        void onDoFollowSeriesSuccess(BaseModel<Object> successResult);
        void onDoFollowSeriesFailure(BaseModel<Object> failureResult);

        String getSeriesId();
    }

    interface Stores {
        @FormUrlEncoded
        @POST(Constants.URL_CAR_SERIES_DETAIL)
        Observable<BaseModel<CarSeriesInfo>> getSeriesInfo(@Field("Id") String Id);

        @FormUrlEncoded
        @POST(Constants.URL_CAR_ADD_INSTALLMENT)
        Observable<BaseModel<Object>> addInstallment(
                @Field("carid") String carid,
                @Field("shopids") String shopids,
                @Field("phone") String phone,
                @Field("name") String name,
                @Field("city") String city);
        @FormUrlEncoded
        @POST(Constants.URL_CAR_ADD_SHOP_INQUIRY)
        Observable<BaseModel<Object>> addShopInquiry(
                @Field("type") String type,
                @Field("carid") String carid,
                @Field("shopids") String shopids,
                @Field("phone") String phone,
                @Field("name") String name,
                @Field("city") String city);

        @FormUrlEncoded
        @POST(Constants.URL_ADD_FOLLOW)
        Observable<BaseModel<Object>> doFollowSeries(
                @Field("orgid") String orgid,
                @Field("type") String type
        );
        @FormUrlEncoded
        @POST(Constants.URL_GET_SALER_TEL)
        Observable<BaseModel<TelInfo>> getSalespersonTel(
                @Field("Id") String Id
        );
    }

    interface Presenter {
        void getSeriesInfo();
        void addInstallment(String carid, String shopids, String phone, String name, String city);
        void addShopInquiry(String carid, String shopids, String phone, String name, String city);
        void doFollowSeries();
        void getSalespersonTel();
    }

}